package ustc.xiaoyang.karl.hashtable;

/**
 * 383.赎金信  easy
 */
public class Ransom383 {
    public static void main(String[] args) {

    }
    public static boolean canConstruct(String ransomNote, String magazine) {
        int[] count = new int[26];
        for (int i = 0; i < ransomNote.length(); i++) {
            count[ransomNote.charAt(i) - 'a']++;
        }
        for (int i = 0; i < magazine.length(); i++) {
            count[magazine.charAt(i) - 'a']--;
        }
        for (int i = 0; i < count.length; i++) {
            if(count[i] > 0) return false;
        }
        return true;
    }
}
